package poubelle.css;

public class CSSGlobalPanel extends CSSDiv {

	private String margin = "";
	private String padding = "";
	private String height = "";
	private String width = "";
	private String background = "";
	private String style = "";

	public String getCSS(String nameClass) {
		if (margin.length() != 0 || padding.length() != 0
				|| height.length() != 0 || width.length() != 0
				|| background.length() != 0 || style.length() != 0)
			return nameClass + "{\n" + margin + padding + height + width
					+ background + style + "}\n";
		else
			return "";
	}

	@Override
	public String getCSSChild(String nameClass, boolean isHorizontalPanel) {
		// TODO Auto-generated method stub
		return null;
	}

	public void setStyle(String style) {
		this.style = style;
	}

	public void setMargin(String margin) {
		this.margin = (margin != null) ? "margin:" + margin + ";\n"
				: "margin:auto;";
	}

	public void setPadding(String padding) {
		this.padding = (padding != null) ? "padding:" + padding + ";\n"
				: "padding:0px;";
	}

	public void setHeight(String height) {
		this.height = (height != null) ? "height:" + height + ";\n" : "";
	}

	public void setWidth(String width) {
		this.width = (width != null) ? "width:" + width + ";\n" : "";
	}

	public void setBackground(String background) {
		this.background = (background != null) ? "background:" + background
				+ ";\n" : "";
	}
}
